<template>
  <div class="hello">
    <li class="list-group-item">
      <div class="handle" @click="del">删除</div>
      <p class="user"><span >{{comment.name}}</span><span>说:</span></p>
      <p class="centence">{{comment.age}}</p>
    </li>
  </div>
</template>

<script>
export default {
  props: {
    comment: Object,
    delItem: {
      type: Function,
      required: true
    }
  },
  methods: {
    del () {
      this.delItem(this.comment)
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  li {
    transition: .5s;
    overflow: hidden;
  }

  .handle {
    width: 40px;
    border: 1px solid #ccc;
    background: #fff;
    position: absolute;
    right: 10px;
    top: 1px;
    text-align: center;
  }

  .handle a {
    display: block;
    text-decoration: none;
  }

  .list-group-item .centence {
    padding: 0px 50px;
  }

  .user {
    font-size: 22px;
  }
</style>
